{include file="public/_head" /}
<!-- Main Container -->
<div class="main-container container-fluid">
    <!-- Page Container -->
    <div class="page-container">

        <!-- Page Sidebar -->
        {include file="public/_left" /}
        <!-- /Page Sidebar -->
        <!-- Page Content -->
        <div class="page-content">
            <!-- Page Breadcrumb -->
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="fa fa-home"></i>&nbsp;报名信息管理
                    </li>
                    <li>报名信息列表</li>
                </ul>
            </div>
            <!-- /Page Breadcrumb -->
            <!-- Page Body -->
            <div class="page-body">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="widget">
                            <div class="widget-header">
                                <span class="widget-caption">报名信息列表</span>
                                <div class="widget-buttons">
                                    {$sign|replaces}
                                </div>
                            </div>
                            <div class="widget-body">
                                <table class="table table-hover table-bordered">
                                    <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>姓名</th>
                                        <th>联系电话</th>
                                        <th>报名学校</th>
                                        <th>报名专业</th>
                                        <th>报名时间</th>
                                        <th>处理状态</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    {volist name='sign' id='v'}
                                    <tr>
                                        <td>{$v.id}</td>
                                        <td>{$v.sign_name}</td>
                                        <td>{$v.phone}</td>
                                        <td>{$v.school}</td>
                                        <td>{$v.major}</td>
                                        <td>{$v.create_time}</td>
                                        <td>{if $v.status==1}已处理{else}未处理{/if}</td>
                                        <td>
                                            <!--{if $v.status == 0}-->
                                            <a href="#" dataid="{$v.id}" status="{$v.status}" class="btn btn-success btn-xs member-status">处理</a>
                                            <!--{else}
                                            <a href="#" dataid="{$v.id}" status="{$v.status}" class="btn btn-warning btn-xs member-status">隐藏</a>
                                            {/if}-->
                                            <!--<a href="{:url('admin/about/content_edit',['id'=>$v.id])}" class="btn btn-azure btn-xs">编辑</a>-->
                                            <a href="#" class="btn btn-sm btn-danger admin-del" dataid="{$v.id}">删除</a>
                                        </td>
                                    </tr>
                                    {/volist}
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->

    </div>
    <!-- /Page Container -->
    <!-- Main Container -->

</div>

{include file="public/_js" /}
<script>
    $(function () {
        //报名信息处理
        $('.member-status').click(function () {
            var id = $(this).attr('dataid');
            var status = $(this).attr('status');
            if (status == 0){
                var msg = '确认该报名信息已经处理了吗？';
            }
            layer.confirm(msg,{
                title:'报名是否处理',
                icon:3
            },function (index) {
                layer.close(index);
                $.ajax({
                    url:"{:url('admin/sign/sign_status')}",
                    type:'post',
                    data:{id:id,status:status},
                    dataType:'json',
                    success:function (data) {
                        if (data.code == 1){
                            layer.msg(data.msg,{
                                icon:6,
                                time:1000
                            },function () {
                                location.href = data.url;
                            });
                        } else {
                            layer.open({
                                title:'处理情况',
                                content:data.msg,
                                icon:5,
                                anim:6
                            });
                        }
                    }
                });
            });
            return false;
        });
        //删除报名信息
        $('.admin-del').click(function () {
            var id = $(this).attr('dataid');
            layer.confirm('确认删除该条报名信息吗？',{
                title:'删除操作',
                icon:3
            },function(index){
                layer.close(index);
                $.ajax({
                    url:"{:url('admin/sign/sign_del')}",
                    type:'post',
                    data:{id:id},
                    dataType:'json',
                    success:function(data){
                        if (data.code == 1){
                            layer.msg(data.msg,{
                                icon:6,
                                time:1000
                            },function () {
                                location.href = data.url;
                            });
                        } else {
                            layer.open({
                                title:'删除操作',
                                content:data.msg,
                                icon:5,
                                anim:6
                            });
                        }
                    }
                });
            });
            return false;
        });
    });
</script>
</body>
<!--  /Body -->
</html>

